
/*
 * board_asm.s
 *
 * Created: 6/25/2013 4:23:48 PM
 *  Author: Tim
 */ 
 #include <avr/io.h>

	.global nvmRead
nvmRead:
 	lds r20, NVM_CMD          ; Store NVM command register
	mov ZL, r22               ; Load byte index into low byte of Z.
	mov ZH, r23               ; Load high byte into Z.
	sts NVM_CMD, r24          ; Load prepared command into NVM Command register.
	lpm r24, Z                ; Perform an LPM to read out byte
	sts NVM_CMD, r20          ; Restore NVM command register

	ret